#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include "asr_offline_sample.h"
#include "server.h"

int main(int argc, char *argv[]) 
{
    // if (argc != 3)
    // {
    //     printf("Usage: %s ip port\n", argv[0]);
    //     return -1;
    // }
    

    //初始化(服务器初始化、语音识别初始化)
    //server_init(argv[1], atoi(argv[2]));
    server_init("192.168.31.100", 8080);
    voice_init();

    while(1)
    {
        //接收客户端发送的文件   save_voice_file
        save_voice_file();

        //识别接收到的文件，得到id号，voice_identify
        voice_identify();

        //将识别后的id号发给客户端
        printf("id = %d\n", id);
        write(connect_fd, &id, 4);
        id = 0;

    }


}